package com.zglc.ms.shop.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.zglc.ms.shop.service.CacheManagerUtil;

@Component
public class Scheduler {

	@Autowired
	private CacheManagerUtil cacheManagerUtil;
	
	private Logger logger = LoggerFactory.getLogger(getClass());
	
    @Scheduled(cron="0 0 */1 * * ?") // 每整点执行一次  
    public void statusCheck() {      
        logger.info("清理首页缓存 每整点执行一次,开始。");  
        cacheManagerUtil.jDel("shopHomeTemplates");
        logger.info("清理首页缓存 每整点执行一次,结束。");  
    }   
}
